import { PageContainer } from '@ant-design/pro-components';
import React, {useEffect, useState} from 'react';
import { message} from "antd";
import { SmileOutlined } from '@ant-design/icons';
import { Timeline } from 'antd';

import {
  listInterfaceInfoByPageUsingGet
} from "@/services/liangapi-backend/interfaceInfoController";

const Index: React.FC = () => {
  const [loading, setLoading] = useState(false);
  const [list, setList] = useState<API.InterfaceInfo[]>([]);
  const [total, setTotal] = useState<number>(0);
  const loadData = async(current=1, pageSize=5) =>{
    setLoading(true);
    try {
      const res = await listInterfaceInfoByPageUsingGet({})
      setList(res?.data?.records ??[])
      setTotal(res?.data?.total ?? 0)
    } catch (error: any) {
      message.error('请求失败' + error.message);

    }
    setLoading(false);
  }
  useEffect(() => {
    loadData();
  }, []);
  return (
    <PageContainer title="个人时间线">
      <Timeline
        items={[
          {
            color: 'green',
            children: (
              <>
                <p>2017.09-2020.06 辽宁建筑职业学院</p>
                <p>2018.11-2019.06 大连中软国际培训</p>
                <p>2019.07-2020.07 大连和众信拓(实习)</p>
              </>
            ),
          },
          {
            color: 'green',
            children: '2020.07-2021.01 大连和众信拓(正式)',
          },
          {
            color: 'green',
            children: (
              <>
                <p>2021.12-2022.11 丽堃辽宁科技</p>
              </>
            ),
          },
          {
            children: (
              <>
                <p>2022.9-2024.6 沈阳航空航天大学</p>
                <p>2023.9-2024.4 辽宁云盟数字科技</p>
              </>
            ),
          },
          {
            color: '#00CCFF',
            dot: <SmileOutlined />,
            children: <p>job-hunt</p>,
          },
        ]}
      />
    </PageContainer>
  );
};

export default Index;
